<?php
$this->load->view("header");
?>
<div id="main_content">
<div class="titlebar">
    <table>
    <tr>
    <td style="font-weight:bold"><?= $title;?></td>
    <td><?php for($i=0;$i<50;$i++) echo "&nbsp;"; ?></td>
    <td style="font-weight:bold">书店位置:</td>
    <td>
   <?php $link=site_url()."/bookiki/bookshop?campusid="?>
    <select  onchange="window.location.href=this.options[this.selectedIndex].value">
       <?php if($campusid==-1){ ?>
       <option  value="<?=$link."-1&go=yes"?>" selected="selected">所有校区</option>
       <?php }else{?>
       <option  value="<?=$link."-1&go=yes"?>" >所有校区</option>
       <?php 
        } foreach($allcampus as $campus){
              if($campusid==$campus->id){ ?>
                 <option value="<?=$link.$campus->id."&go=yes"?>" selected="selected"><?=$campus->name?></option>
             <?php }else{?>
                 <option value="<?=$link.$campus->id."&go=yes"?>" ><?=$campus->name?></option>
       <?php }
        } ?>
    </select>
    </td>
    </tr>
    </table>

</div>

<?php
$this->load->view("bookiki/leftcolumn");
?>

<div id="book_list" class="book_list">
<?php
if($shops==null)
echo "抱歉，这所学校或这个校区暂时没有书店。";
else{
  foreach($shops as $shop){?>
  <table id="book_item" cellspacing="0" cellpadding="0" class="BookItem" onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
  <tbody>
  <tr class="tr-margin"><td></tr>
  <tr>
    <td valign="top" align="left" >
        <table class="BookInfo" cellspacing="0" cellpadding="0" width="100&percnt;">
        <tbody><tr>
        <td  class="title"  align="left"><a href="<?=site_url()?>/bookiki/enterShop?id=<?=$shop->id?>&go=yes" name="landingpagelink"><?php if($shop->shopname!=null) echo $shop->shopname; else echo $shop->id."的书店"?></a>
        </td></tr>
        <tr><td>
        <table><tr>
        <td class="tracks" colspan="10" align="left">店主：<?=$shop->id?></td>
        <td class="tracks" colspan="10" align="left">位置：<?=$shop->campus?></td>
        <td class="tracks" colspan="10" align="left">藏书量：<?=$shop->numsales+$shop->numwanted?></td>
        <td>&nbsp;&nbsp;</td>
        <td class="tracks" colspan="10" align="left">成交量：<?=$shop->numsaledeals+$shop->numwanteddeals?></td>
        <td>&nbsp;&nbsp;</td>
        <td class="tracks" colspan="10" align="left">积分：<?=$shop->money?></td>
        <td>&nbsp;&nbsp;</td>
        <td class="tracks" colspan="10" align="left"><a href="<?=site_url()?>/user/edit_msg?receiver=<?=$shop->id?>&go=yes">发站内信</a></td>
        </tr></table>
        </td></tr>
         </tbody></table>
    </td>
   </tr>
   </tbody>
   </table>

<?php
 } //end of foreach
?>
<div class="pagination">
    <?php echo $this->mypagination->create_links();?>
</div>
<?php
} //end of else
?>

</div><!--end of book_list-->

<?php
$this->load->view("footer");
?>


